﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Box.Entities;
namespace Box.Repository
{
    public class MarcaRepository : MasterRepository, IMarcaRepository
    {

        public List<Marca> GetAllFromMarcas()
        {
            var query = from c in Context.Marcas
                        select c;
            return query.ToList();
        }

        public List<Marca> GetFromMarcasByCriterio(string criterio)
        {
            var query = from c in Context.Marcas
                        select c;
            if (criterio != null && criterio != string.Empty)
            {
                query = from c in query
                        where c.NombreMarca.ToUpper().Contains(criterio.ToUpper())

                        select c;
            }
            return query.ToList();
        }

        public Marca GetFromMarcaById(int id)
        {
            throw new NotImplementedException();
        }

        public void AddMarca(Marca Marca)
        {
            throw new NotImplementedException();
        }

        public void UpdateMarca(Marca Marca)
        {
            throw new NotImplementedException();
        }

        public void RemoveMarca(int id)
        {
            throw new NotImplementedException();
        }
    }
}
